﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.Design;

namespace Syk.Library.Extensions
{
    public static class ComponentModelExtensions
    {
        public static T GetService<T>(this IServiceProvider provider)
            where T: class
        {
            return provider.GetService(typeof(T)) as T;
        }

        public static void AddService<T>(this IServiceContainer container, T instance)
            where T : class
        {
            container.AddService(typeof(T), instance);
        }
    }
}
